<template>
	<view class="category-index">
		<view class="category" v-for="(item,index) in typeList" :key="index" @click="caregory(item)">
			{{item.title}}
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			typeList: Array,
		},
		data() {
			return {

			}
		},
		methods: {
			caregory(item){
				if(item.type=='secondary'){
					this.$tools.navigate(`/pages/home/searchWork/index?params=${JSON.stringify(item)}`)
				}
				else{
					this.$tools.navigate(`/pages/home/searchWork/index?params=${JSON.stringify(item)}`)
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	.category-index {
		padding: 17rpx 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.category {
			width: 20%;
			padding: 10rpx 13rpx;
			background: #EBEBEB;
			margin-right: 13rpx;
			font-size: 26rpx;
			font-weight: 400;
			color: #414143;
			text-align: center;
			border-radius: 4rpx;
		}
	}
</style>
